import pymysql
db = pymysql.connect("localhost","root","1234","test1")
cursor = db.cursor()
# cursor.execute("select version()")
# data = cursor.fetchone()
# print("database version: %s" % data)
data = [1,'hj','138438']
sql = """insert into hj_test(id,name,telephone) values('%d','%s','%s')"""
cursor.execute(sql %(data[0],data[1],data[2]))
db.commit()
db.close()